-module (greeting).
-author leeyi.
-export ([hello/0, hello/1, test/0, greet/2]).
%% Shows greetings.
%% io:format/1 is the standard function used to output text.
hello() ->
	io:format("Hello, world!~n").
hello(Who) ->
	io:format("Hello, ~s~n", [Who]).

test() ->
	Chinese = unicode:characters_to_list("中文测试"),
	io:format("~ts~n", [Chinese]),
	Pi = math:pi(),
	io:format("Pi is ~50.20f~n", [Pi]),
	io:format("|~10.9c|~n", [$a]),
	L = lists:seq(1, 100),
	io:format("L is ~p~n",[L]).

greet(male, Name) ->
	io:format("Hello, Mr. ~s!", [Name]);
greet(female, Name) ->
	io:format("Hello, Mrs. ~s!", [Name]);
greet(Name, _) ->
	io:format("Hello, ~s!", [Name]).